<?php
$pathArr = explode("/", $_SERVER["PHP_SELF"]);
$contextPath = $pathArr[1];
$rootPath = $_SERVER["DOCUMENT_ROOT"];
include_once $rootPath . "/" . $contextPath . "/apps/ManagerIUDS.php";
$managerIUDS = new ManagerIUDS();

$mode = $_GET["mode"];
if($mode == "update"){
	$getListRecreationRoom = $managerIUDS->queryData("*", "recreation_room", " WHERE recreation_room_id = ".$_GET["recreation_room_id"], "1", "=");
	//$petDataList = $managerIUDS->queryData("pet_id,pet_name","pet","","2","");
}else{
	//$petDataList = $managerIUDS->queryData("pet_id,pet_name","pet","","2","");
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.: Recreation Room Detail :.</title>
<?php
require_once($rootPath . "/" . $contextPath . "/includes/css_inc.php");
require_once($rootPath . "/" . $contextPath . "/includes/js_inc.php");
?>
<script type="text/javascript">
			$(document).ready(function(){ 
				$("#save_data").click(function(){
					var result = true;
					if($("#recreation_room_number").val()=="" || $("#recreation_room_number").val()==null){
						alert("Recreation Room Number is null Plase check value");
						$("#recreation_room_number").focus(); 
						result = false;
					}
					else if($("#price").val()=="" || $("#price").val()==null){
						alert("Price is null Plase check value");
						$("#price").focus(); 
						result = false;
					}
					if(result){
						$("#frm1").submit();
					}
				});
				$(function() {
					$( "#combobox" ).combobox();
				});
			}); 
		</script>
</head>
<body>
<center>
<form name="frm1" id="frm1" action="../actions/recreation_room_action.php" method="post">
<table border="0" width="75%">
	<thead class="ui-widget">
		<tr class="ui-widget-header">
			<th colspan="2" align="left">&nbsp;&nbsp;&nbsp;รายละเอียดห้องพัก</th>
		</tr>
	</thead>
	<tbody class="ui-widget-content">
		<tr>
			<td align="right">หมายเลขห้องพัก : </td>
			<td><input type="text" name="recreation_room_number" id=recreation_room_number value="<?=$getListRecreationRoom["recreation_room_number"]?>"></td>
		</tr>
		<tr>
			<td align="right">รายละเอียดห้องพักl : </td>
			<td>
				<textarea name="recreation_room_detail" id="recreation_room_detail" cols="21"	rows="5"><?=$getListRecreationRoom["recreation_room_detail"]?></textarea>
			</td>
		</tr>
		<tr>
		<td align="right">น้ำหนักสัตว์เลี้ยงที่ห้องจำกัด :</td>
				<td><input type="radio" name="recreation_room_limit_weight" id="recreation_room_limit_weight" value="L" checked="checked">น้อยกว่า 25
					<input type="radio" name="recreation_room_limit_weight" id="recreation_room_limit_weight" value="M"
					<?php
					if($getListRecreationRoom["recreation_room_limit_weight"] == "M"){
					?>
					checked="checked"
					<?php
	           	   	}
	           	   	?>>มากกว่า 25
	           	</td>
		<tr>
		<tr>
			<td align="right">ราคา/คืน:</td>
			<td><input type="text" name="price" id=price value="<?=$getListRecreationRoom["price"]?>" onkeypress="return numbersOnly(event, false);" ></td>
		</tr>
		<tr>
		<td align="right">สถานะ :</td>
			<td><input type="radio" name="is_free" id="is_free" value="Y" checked="checked">ว่าง 
				<input type="radio" name="is_free" id="is_free" value="N"
				<?php
				if($getListRecreationRoom["is_free"] == "N"){
				?>
				checked="checked"
				<?php
           	   	}
           	   	?>>ไม่ว่าง
           	</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
			<input type="button" name="save_data" id="save_data" value="บันทึก">
			<input type="button" value="ยกเลิก"	onclick="window.location='recreation_room_main.php';"></td>
		</tr>
	</tbody>
</table>
<input type="hidden" id="mode" name="mode" value=<?=$mode?>>
<input	type="hidden" id="recreation_room_id" name="recreation_room_id" value="<?=$_GET["recreation_room_id"]?>">
</form>
</center>
</body>
</html>